package com.sky.controller.user;

import com.sky.result.Result;
import com.sky.service.DishService;
import com.sky.vo.DishVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 菜品管理
 */
@Api(tags = "菜品管理")
@RequestMapping("/user/dish")
@RestController("UserDishController")
public class DishController {

    private static final Logger log = LoggerFactory.getLogger(DishController.class);
    @Autowired
    private DishService dishService;

    @ApiOperation("菜品列表查询")
    @GetMapping("/list")
    public Result<List<DishVO>> list(@RequestParam("categoryId") Long categoryId){
        log.info("菜品列表查询:{}",categoryId);
        return dishService.list(categoryId);
    }

}
